package com.guigu.xm.lq.mapper;

import com.guigu.xm.pojo.SysRoles;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SysRolesMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(SysRoles record);

    int insertSelective(SysRoles record);

    SysRoles selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(SysRoles record);

    int updateByPrimaryKey(SysRoles record);
    @Select("select * from sys_roles")
    List<SysRoles> allRoles();

    List<SysRoles> selectAllRoles(String login_id);
    @Select("select * from sys_roles where descn=#{descn}")
    SysRoles Addcha(String descn);
    //查倒数第二行数据
    @Select("SELECT * FROM sys_roles  ORDER BY rid DESC LIMIT 1,1")
    SysRoles DaoShu();
    @Insert("insert into sys_roles values(#{rid},null,null,#{descn})")
    int insert2(@Param("rid") int rid, @Param("descn") String descn);
}